<template>
	<view>
		<cu-custom bgColor="bg-white-nav" isBack>
		    <block slot="content">提现</block>
		</cu-custom>
		<view class="top_box">
			<image class="with_bg" src="/static/images/my/withdrawal_bg.png" mode="widthFix"></image>
			<view class="balance">
				<view class="u-flex u-flex-y-center u-flex-center">
					<image class="icon_sym" src="/static/images/my/icon-money.png" mode="widthFix"></image>
					<text class="text">余额</text>
				</view>
				<view class="num">{{$u.priceFormat(balance,2)}}</view>
			</view>
		</view>
		<view class="box">
			<view class="title">提现金额</view>
			<u-input placeholder="请输入提现金额" placeholderClass="l-placeholder" fontSize="56rpx" type="number" border="bottom" v-model="withMoney">
				<template slot="prefix">
					<text>￥</text>
				</template>
				<template slot="suffix">
					<text style="color: #3662EC;" @click="withMoney = balance">全部</text>
				</template>
			</u-input>
			<view class="title m-t50">提现至</view>
			<view>
				<view class="u-flex u-flex-between u-flex-y-center">
					<view class="u-flex u-flex-y-center">
						<image style="width: 66rpx;height: 66rpx;border-radius: 50%;" src="/static/images/my/icon_wx.png"
							mode="widthFix"></image>
						<text class="m-l20 m-r10 pay-text">微信</text>
						<text class="band">绑定微信</text>
					</view>
					<view class="choose-area" @click="chooseWithPay(1)">
						<image v-if="active == 1" class="icon-choose" src="/static/images/my/checked.png" mode="widthFix">
						</image>
						<view v-else class="unchecked"></view>
					</view>
				</view>
				<view class="u-flex u-flex-between u-flex-y-center m-t36">
					<view class="u-flex u-flex-y-center">
						<image style="width: 66rpx;height: 66rpx;border-radius: 50%;" src="/static/images/my/icon_alipay.png"
							mode="widthFix"></image>
						<text class="m-l20 m-r10 pay-text">支付宝</text>
						<text class="band" @click="openUrl('/pages/my/bindPayment')">绑定支付宝</text>
					</view>
					<view class="choose-area" @click="chooseWithPay(2)">
						<image v-if="active == 2" class="icon-choose" src="/static/images/my/checked.png" mode="widthFix">
						</image>
						<view v-else class="unchecked"></view>
					</view>
				</view>
			</view>
			<button class="btn" :style="withMoney ? 'backgroundColor:#3662EC' : '#ccc'">立即提现</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				balance: '999999',
				withMoney: '',
				active: 1,
			}
		},
		methods: {
			chooseWithPay(status) {
				this.active = status
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #fff;
	}
	.with_bg {
		width: 100%;
	}
	.l-placeholder {
		// font-size: 56rpx;
		// color: #ccc;
		// font-weight: 600;
		// line-height: 74rpx;
	}
	.icon_sym {
		width: 40rpx;
		height: 40rpx;
	}

	.top_box {
		position: relative;
	}

	.balance {
		color: #fff;
		position: absolute;
		left: 0;
		right: 0;
		top: 50%;
		transform: translateY(-50%);
		text-align: center;
	}

	.text {
		font-size: 30rpx;
		margin-left: 8rpx;
	}

	.num {
		font-size: 60rpx;
		margin-top: 20rpx;
		line-height: 80rpx;
	}

	.box {
		border-top-left-radius: 30rpx;
		border-top-right-radius: 30rpx;
		padding: 50rpx 30rpx 0;
		background: #fff;
		position: relative;
		top: -30rpx;

		.title {
			font-size: 30rpx;
			color: #333;
			margin-bottom: 30rpx;
		}
	}

	.pay-text {
		font-size: 34rpx;
		color: #111;
	}

	.band {
		font-size: 26rpx;
		color: #3662EC;
	}

	.icon-choose {
		width: 40rpx;
		height: 40rpx;
		border-radius: 50%;
	}

	.unchecked {
		width: 40rpx;
		height: 40rpx;
		border: 2rpx solid #ccc;
		border-radius: 50%;
	}
	.choose-area {
		padding-left: 40rpx;
	}
	.btn {
		margin-top: 80rpx;
		height: 96rpx;
		line-height: 96rpx;
		color: #fff;
		background-color: #ccc;
		font-size: 30rpx;
		border: none;
		&::after {
			border: none;
		}
	}
</style>